<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="class.js"></script>
    <script src="event.bus.js"></script>
</head>

<body>
    <script>
        window.eventBus = new EventBus();

        var HelloWorld = {
            send1: function (name) {
                console.log("send1----------" + name);
            },
            send2: function (name) {
                console.log("send2----------" + name);
            }
        }

        var HelloWorld2 = {
            send3: function (name) {
                console.log("send3----------" + name);
            },
            send4: function (name) {
                console.log("send4----------" + name);
            }
        }


        eventBus.bind(HelloWorld);
        eventBus.bind(HelloWorld2);
        eventBus.emit("send1", "你好");
        eventBus.emit("send2", "你好");
        eventBus.emit("send3", "你好");
        eventBus.emit("send4", "你好");


    </script>
</body>

</html>